package com.ruoyi.file.config;

import com.aliyun.oss.OSS;
import com.aliyun.oss.OSSClientBuilder;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 类名：
 * 作者：WF
 * 功能：
 */
@Configuration
@ConfigurationProperties(prefix = "oss")
@Data
public class OssConfig {
	private String endpoint;
	private String accesskey;
	private String accessSecret;
	private String bucketName;

	// 得到oss客户端
	@Bean
	public OSS ossClient(){
		return new OSSClientBuilder().build(endpoint,accesskey,accessSecret);
	}
}
